/*
 * DecisionTree.h
 *
 *  Created on: 07/07/2012
 *      Author: marcio
 */

#ifndef DECISIONTREE_H_
#define DECISIONTREE_H_

#include "Tree.h"

typedef struct _tree{
	void* values;
	int size;
}DecisionTreeNode;

typedef struct _tree{
	DecisionTreeNode** (*f)(DecisionTreeNode* node, int i, int* size);
	DecisionTreeNode* root;
	int size;
}DecisionTree;

DecisionTree* decisontree_newDecisonTree(DecisonTreeNode** (*f)(void*, int i, int* size), int size);

Tree* decisionTree_expandTree(DecisionTree* d);

DecisionTreeNode** decisiontree_enumerateLeafs(DecisionTree* d, int level, void** initvalues, int* size);

DecisionTreeNode** decisiontree_BFS(DecisionTree* d, int (*filter)(void*, int), int value);

DecisionTreeNode** decisiontree_DFS(DecisionTree* d, int (*filter)(void*, int), int value);

DecisionTreeNode* decisiontree_BFSSearch(DecisionTree* d, int (*lookup)(void*));

DecisionTreeNode* decisiontree_DFSSearch(DecisionTree* d, int (*lookup)(void*));

double decisiontree_optmizeBFS(DecisionTree* d, double (*lowerbound)(void*), double (*upperbound)(void*));

double decisiontree_optmizeDFS(DecisionTree* d, double (*lowerbound)(void*), double (*upperbound)(void*));


#endif /* DECISIONTREE_H_ */
